import {DECREASE, INCREMENT} from "./constant";

export default function CountReduce(pre=0,action){
    const{type,data}=action
    console.log(pre,action,'reducer')
    switch (type){
        case INCREMENT:
            return pre+data
        case DECREASE:
            return pre-data
        default:
            return pre
    }
}
